# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libical
pkgver=3.0.18
pkgrel=0
pkgdesc="Reference implementation of the iCalendar format"
url="https://libical.github.io/libical/"
arch="all"
license="LGPL-2.1-only OR MPL-2.0"
depends_dev="libxml2-dev gobject-introspection-dev"
makedepends="perl cmake vala glib-dev icu-dev samurai $depends_dev"
checkdepends="tzdata py3-gobject3"
subpackages="$pkgname-dev"
source="https://github.com/libical/libical/releases/download/v$pkgver/libical-$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DSHARED_ONLY=true \
		-DENABLE_GTK_DOC=false \
		-DGOBJECT_INTROSPECTION=true \
		-DICAL_GLIB_VAPI=true
	cmake --build build
}

check() {
	cd build
	ctest -E '(icalrecurtest|icalrecurtest_r)'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
53ecf6c14a68d569dd11bfdeb1a072def847a14d189c6af16eab202e004350ee7d9488c6b63e9cb67889e8c2dec90643fef46aec143a915f28270d0752eaa9d5  libical-3.0.18.tar.gz
"
